﻿/**
 * @file   FITKNastranAbstractAdaptor.h
 * @brief  抽象的Nastran文件读写适配器
 * @author zhourp (zhourunping@diso.cn)
 * @date   2024-03-15
 */
#ifndef FITKNASTRANABSTRACTADAPTOR_H
#define FITKNASTRANABSTRACTADAPTOR_H

#include "FITKNastranBDFIOAPI.h"
#include "FITKNastranBDFReader.h"
#include "InpNastranReaderHelper.h"

#include "FITK_Kernel/FITKAdaptor/FITKAbstractIOAdaptor.h"

namespace Nastran
{
/**
 * @brief the abstract class of adaptor for Nastran
 *
 * @author: zhourp (zhourunping@diso.cn)
 * @date: 2024-11-14
 */
class FITKNastranBDFIOAPI FITKNastranAbstractAdaptor : public Adaptor::FITKAbstractIOAdaptor
{
    FITKCLASS(Nastran, FITKNastranAbstractAdaptor);

  public:
    explicit FITKNastranAbstractAdaptor() = default;

    virtual ~FITKNastranAbstractAdaptor() = 0;

    /**
     * @brief Set the reader for the FITKNastranAbstractAdaptor.
     *
     * @param[in] reader Pointer to the FITKNastranBDFReader object to be set.
     * @author zhourp (zhourunping@diso.cn)
     * @date 2024-11-13
     */
    void setReader(FITKNastranBDFReader *reader);

    /**
     * @brief Set the helper for the FITKNastranAbstractAdaptor.
     *
     * @param[in] helper Pointer to the InpNastranReaderHelper object to be set.
     * @author zhourp (zhourunping@diso.cn)
     * @date 2024-11-13
     */
    void setHelper(InpNastranReaderHelper *helper);

  protected:
    /**
     * @brief Get the helper of the FITKNastranAbstractAdaptor.

    * @return Pointer to the InpNastranReaderHelper object.
    * @author zhourp (zhourunping@diso.cn)
    * @date 2024-11-13
    */
    InpNastranReaderHelper *getHelper();

    /**
     * @brief Get the reader of the FITKNastranAbstractAdaptor.
     *
     * @return Pointer to the FITKNastranBDFReader object.
     * @author zhourp (zhourunping@diso.cn)
     * @date 2024-11-13
     */
    FITKNastranBDFReader *getReader();

  private:
    /**
     * @brief BDF文件读取器
     * @author zhourp (zhourunping@diso.cn)
     * @date 2024-03-15
     */
    FITKNastranBDFReader *_reader{};

    /**
     * @brief BDF文件读取帮助类
     * @author zhourp (zhourunping@diso.cn)
     * @date 2024-11-13
     */
    InpNastranReaderHelper *_helper{};
};
} // namespace Nastran
#endif // FITKNASTRANABSTRACTADAPTOR_H
